package com.sharefang.aproject.biz.npp;

import com.orhanobut.logger.Logger;
import com.sharefang.aproject.bean.NppBean;
import com.sharefang.aproject.net.RxSubscribe;
import com.sharefang.aproject.net.ServiceFactory;

import java.util.List;
import java.util.Map;

import rx.Observable;

/**
 * Created by Administrator on 2016/8/16.
 */

public class NppBiz implements INppBiz {
    @Override
    public void getNpp(String url, Map<String, Object> map, boolean loadMore , final OnNppResultListener listener) {
        Observable<List<NppBean>> observable = ServiceFactory.INSTANCE.getNpp(url, map);
        observable.subscribe(new RxSubscribe<List<NppBean>>() {
            @Override
            protected void _onNext(List<NppBean> nppBeen) {

                listener.onSuccess(nppBeen);
            }

            @Override
            protected void _onError(String message) {
                listener.onFailure(message);
            }
        });
    }
}
